<?php

namespace backend\models\odm;

use Yii;

/**
 * This is the model class for table "xs_user_consume".
 *
 * @property string $id
 * @property integer $user_id
 * @property integer $status
 * @property string $pay_coin
 * @property string $novel_id
 * @property string $novel_chapter
 * @property string $pay_time
 */
class UserConsumeOdm extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'xs_user_consume';
    }
    
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'status', 'novel_id', 'novel_chapter','main','category'], 'integer'],
            [['pay_coin'], 'number'],
            [['pay_time'], 'safe'],
            [['novel_title','phone'], 'string']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', '消费记录id'),
            'user_id' => Yii::t('app', '用户id'),
            'status' => Yii::t('app', '状态[0:失败,1:成功]'),
            'pay_coin' => Yii::t('app', '消费阅币数'),
            'novel_id' => Yii::t('app', '小说id'),
            'novel_chapter' => Yii::t('app', '章节id'),
            'pay_time' => Yii::t('app', '消费时间'),
            'novel_title' => Yii::t('app', '书籍名称'),
            'phone' => Yii::t('app', '用户账号'),
            'main' => Yii::t('app', '小说主分类'),
            'category' => Yii::t('app', '小说分类'),
        ];
    }
}
